package com.cloudbroker.openapi.manage.controller;

import com.cloudbroker.bcs.common.entity.HSBCPSBackVO;
import com.cloudbroker.bcs.common.util.VOUtil;
import com.cloudbroker.bcs.platform.ltb.bizapi.service.user.back.UserLoginBack;
import com.cloudbroker.bcs.platform.ltb.bizapi.service.customer.vo.*;
import com.cloudbroker.bcs.platform.ltb.bizapi.service.customer.back.*;
import com.cloudbroker.bcs.platform.ltb.bizapi.t2service.business.CustomerT2BizService;
import com.cloudbroker.bcs.platform.ltb.common.ext.annotation.SaveLog;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import static com.cloudbroker.bcs.platform.ltb.common.util.RequestUtil.getSingleParameterMapForBody;

/**
 * Created by tianrui on 2016/7/5.
 */

@Controller
public class CustomerController {

    @Resource
    private CustomerT2BizService customerT2BizService;

    /**
     * 用户注册
     * */
    @ResponseBody
    @RequestMapping("/customer_register")
    @SaveLog(remark = "用户注册")
    public UserLoginBack CustomerRegister(HttpServletRequest request, String jsonpcallback){
        CustomerRegForm form = getSingleParameterMapForBody(request , CustomerRegForm.class);
        return VOUtil.setJsonpResult(customerT2BizService.funcCustomerRegister(form), jsonpcallback);
    }
}
